Question: Let $A$, $M$, and $C$ be nonnegative integers such that $A+M+C=12$. What is the maximum value of \[A\cdot M\cdot C+A\cdot M+M\cdot
C+C\cdot A?\]
Solution: Let $q$ be the given quantity, $AMC+AM+MC+CA$. Notice that \[q + (A+M+C) + 1 = (A+1)(M+1)(C+1).\]By AM-GM,
\[(A + 1)(M + 1)(C + 1) \le \left[ \frac{(A + 1) + (M + 1) + (C + 1)}{3} \right]^3 = \left( \frac{A + M + C + 3}{3} \right)^3 = 125,\]so $q \le 125 - 12 - 1 = 112.$

Equality occurs when $A = M = C = 4,$ so the maximum value is $\boxed{112}.$